﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace Kxzz
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            try
            {
                ///初始化表情
                for (int i = 0; i < 98; i++)
                {
                    string strFilePath = Application.StartupPath + @"\face2\" + (i + 1).ToString() + ".gif";
                    System.Drawing.Image image = null;
                    if (System.IO.File.Exists(strFilePath))
                    {
                        image = System.Drawing.Image.FromFile(strFilePath);
                    }
                    else
                    {
                        image = Properties.Resources.Help;
                    }

                    Init.ImageListFace.Images.Add(i.ToString(), image);
                }

                Init.setAttribute("Logout", true);

                while ((bool)Init.getAttribute("Logout"))
                {
                    Application.Run(new frmLogin());
                    //如果登录则显示主窗体
                    if (Init.getAttribute("LoginState") != null && (bool)Init.getAttribute("LoginState"))
                        Application.Run(new frmMain());
                }
            }
            catch (Exception ex)
            {
                Kaixin001.Common.ExceptionHelper.SaveLog("Main()", ex);
            }
        }
    }
}
